package com.silences.pojo;

//pojo 实体层


import java.util.Date;

//用户实体， 也叫用户对象
public class User {
    //定义属性
    //Java 基本数据类型，int，float，double，long，byte，boolean，char
    //Java 引用类型：String，自定义对象
    private int id;
    private String username;
    private String password;
    private String avatar;//头像

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public Date getCreatedate() {
        return createdate;
    }

    public void setCreatedate(Date createdate) {
        this.createdate = createdate;
    }

    private Date  createdate; //注册时间（导入的是java.util)

    //实体对象，是通过getter和setter方法进行属性设置和获取
    //鼠标右键 -->点击Generate ---> 选择Getter 和 Setter
    //按shift 选择所以的属性，点击下面的ok 就可以
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    //输出打印信息，toString(),用户对象重写该方法

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                '}';
    }

    //无参构造函数
    public User() {
    }
    //有

    public User(int id, String username, String password, String avatar, Date createdate) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.avatar = avatar;
        this.createdate = createdate;
    }
}
